#ifndef TITLEBAR_H
#define TITLEBAR_H

#include <QWidget>

namespace Ui {
class TitleBar;
}

class TitleBar : public QWidget
{
    Q_OBJECT

public:
    explicit TitleBar(QWidget *parent = 0);
    ~TitleBar();

public:
    void SetHeadImage(const QString& strImg);

protected:
    void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
    void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
    void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;


protected:
    void InitUI(void);

protected slots:
    void ShowMaxMinimized();

private:
    Ui::TitleBar *ui;
    QPoint m_ptPress;
    QPoint m_ptMove;
    bool m_bShowMax = false;
    bool m_bleftBtnClk = false;
};

#endif // TITLEBAR_H
